{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Quantum Development Kit Samples<br>Diagnostics: Facts and Assertions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Preamble"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We'll first open the [Microsoft.Quantum.Diagnostics namespace](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.diagnostics) so that its functions and operations are available throughout the notebook."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[]",
      "text/html": [
       "<ul></ul>"
      ],
      "text/plain": []
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open Microsoft.Quantum.Diagnostics;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dumping Simulator States"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When using Q# programs with a simulator, it can be helpful to ask the simulator for additional diagnostics that aren't available when running on quantum hardware. In particular, when using the `QuantumSimulator` as your target (e.g.: with the `%simulate` command), calling [`DumpMachine`](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.diagnostics.dumpmachine) and [`DumpRegister`](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.diagnostics.dumpregister) will show you the state internal to the simulator.\n",
    "\n",
    "Since `DumpMachine` returns `Unit` and has no effect on the state of any qubits, it will automatically be replaced by a no-op on targets that don't support any additional diagnostics, such as quantum hardware."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"DumpEntangledState\"]",
      "text/html": [
       "<ul><li>DumpEntangledState</li></ul>"
      ],
      "text/plain": [
       "DumpEntangledState"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open Microsoft.Quantum.Preparation;\n",
    "\n",
    "operation DumpEntangledState() : Unit {\n",
    "    use leftRegister = Qubit[2];\n",
    "    use rightRegister = Qubit[2];\n",
    "    \n",
    "    within {\n",
    "        PrepareEntangledState(leftRegister, rightRegister);\n",
    "    } apply {\n",
    "        DumpMachine();\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"div_id\":\"dump-machine-div-0808fb1a-4309-4467-a023-0f6548ea7340\",\"qubit_ids\":[0,1,2,3],\"n_qubits\":4,\"amplitudes\":[{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0}]}",
      "text/html": [
       "\r\n",
       "                    <table style=\"table-layout: fixed; width: 100%\">\r\n",
       "                        <thead>\r\n",
       "                            \r\n",
       "                        <tr>\r\n",
       "                            <th>Qubit IDs</th>\r\n",
       "                            <td span=\"3\">0, 1, 2, 3</td>\r\n",
       "                        </tr>\r\n",
       "                    \r\n",
       "                            <tr>\r\n",
       "                                <th style=\"width: 20ch)\">Basis state (little endian)</th>\r\n",
       "                                <th style=\"width: 20ch\">Amplitude</th><th style=\"width: calc(100% - 26ch - 20ch)\">Meas. Pr.</th><th style=\"width: 6ch\">Phase</th>\r\n",
       "                            </tr>\r\n",
       "                        </thead>\r\n",
       "                        <tbody>\r\n",
       "                        \r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|0\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-0feaa9c2-10db-4842-94e3-f718572dace4\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-0feaa9c2-10db-4842-94e3-f718572dace4\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|1\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-acf924fd-3d8a-41eb-aeaa-9364b2203eb0\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-acf924fd-3d8a-41eb-aeaa-9364b2203eb0\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|2\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-c0c4a4e6-a875-46a5-bdf6-026b6333ae14\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-c0c4a4e6-a875-46a5-bdf6-026b6333ae14\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|3\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-73d56f12-5b32-4ea6-bb99-e8b7ec9b2897\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-73d56f12-5b32-4ea6-bb99-e8b7ec9b2897\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|4\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-2d76d992-6812-434c-95be-b9c97be9188c\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-2d76d992-6812-434c-95be-b9c97be9188c\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|5\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-313e5752-4df6-4b97-bed8-1ee9f095628d\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-313e5752-4df6-4b97-bed8-1ee9f095628d\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|6\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-14d22e6c-91a9-4cd7-84f5-ae2096a8104b\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-14d22e6c-91a9-4cd7-84f5-ae2096a8104b\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|7\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-766cc63e-bd79-41c8-a3e8-c222e0324ea8\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-766cc63e-bd79-41c8-a3e8-c222e0324ea8\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|8\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-db7ec8db-9c44-4523-bf5e-6d7323b05d75\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-db7ec8db-9c44-4523-bf5e-6d7323b05d75\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|9\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-ead77a8b-fdf5-4bab-ab11-4ddfc466bd2a\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-ead77a8b-fdf5-4bab-ab11-4ddfc466bd2a\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-c7471a3c-ce60-44fc-a125-a7f590d9d4f2\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-c7471a3c-ce60-44fc-a125-a7f590d9d4f2\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-41b42554-ab9d-44d1-9228-87dfc4edd907\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-41b42554-ab9d-44d1-9228-87dfc4edd907\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|12\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-a32db53a-e7d5-4235-8445-0c07ed35e1e1\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-a32db53a-e7d5-4235-8445-0c07ed35e1e1\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|13\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-b20ecafe-ddfe-4f35-bbb9-4f74c68494a5\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-b20ecafe-ddfe-4f35-bbb9-4f74c68494a5\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|14\\right\\rangle$</td>\r\n",
       "                                <td>$0.0000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"0\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-94151843-c846-4fa5-bed8-c66817ce5dc1\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 0;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-94151843-c846-4fa5-bed8-c66817ce5dc1\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|15\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-c1404141-c470-4b82-9fae-43899de904f7\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-c1404141-c470-4b82-9fae-43899de904f7\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \r\n",
       "                        </tbody>\r\n",
       "                    </table>"
      ],
      "text/plain": [
       "|0⟩\t0.5000000000000001 + 0𝑖\n",
       "|1⟩\t0 + 0𝑖\n",
       "|2⟩\t0 + 0𝑖\n",
       "|3⟩\t0 + 0𝑖\n",
       "|4⟩\t0 + 0𝑖\n",
       "|5⟩\t0.5000000000000001 + 0𝑖\n",
       "|6⟩\t0 + 0𝑖\n",
       "|7⟩\t0 + 0𝑖\n",
       "|8⟩\t0 + 0𝑖\n",
       "|9⟩\t0 + 0𝑖\n",
       "|10⟩\t0.5000000000000001 + 0𝑖\n",
       "|11⟩\t0 + 0𝑖\n",
       "|12⟩\t0 + 0𝑖\n",
       "|13⟩\t0 + 0𝑖\n",
       "|14⟩\t0 + 0𝑖\n",
       "|15⟩\t0.5000000000000001 + 0𝑖"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "{\"@type\":\"tuple\"}",
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate DumpEntangledState"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The output of `DumpMachine` can be controlled using the [`%config` command](https://docs.microsoft.com/qsharp/api/iqsharp-magic/config). For example, `QuantumSimulator` will show all amplitudes by default, but you can disable this with the `dump.truncateSmallAmplitudes` configuration option. Similarly, the `dump.basisStateLabelingConvention` configuration option controls how basis states are displayed in outputs.\n",
    "\n",
    "> 💡 **TIP** <br/>\n",
    "> For a more complete list of options, run `%config?` in a new cell."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "\"\\\"bitstring\\\"\"",
      "text/plain": [
       "\"bitstring\""
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%config dump.truncateSmallAmplitudes = true\n",
    "%config dump.basisStateLabelingConvention = \"bitstring\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"div_id\":\"dump-machine-div-942c9ab4-c610-42a5-9344-ac371d4682a1\",\"qubit_ids\":[0,1,2,3],\"n_qubits\":4,\"amplitudes\":[{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.0,\"Imaginary\":0.0,\"Magnitude\":0.0,\"Phase\":0.0},{\"Real\":0.5000000000000001,\"Imaginary\":0.0,\"Magnitude\":0.5000000000000001,\"Phase\":0.0}]}",
      "text/html": [
       "\r\n",
       "                    <table style=\"table-layout: fixed; width: 100%\">\r\n",
       "                        <thead>\r\n",
       "                            \r\n",
       "                        <tr>\r\n",
       "                            <th>Qubit IDs</th>\r\n",
       "                            <td span=\"3\">0, 1, 2, 3</td>\r\n",
       "                        </tr>\r\n",
       "                    \r\n",
       "                            <tr>\r\n",
       "                                <th style=\"width: 20ch)\">Basis state (bitstring)</th>\r\n",
       "                                <th style=\"width: 20ch\">Amplitude</th><th style=\"width: calc(100% - 26ch - 20ch)\">Meas. Pr.</th><th style=\"width: 6ch\">Phase</th>\r\n",
       "                            </tr>\r\n",
       "                        </thead>\r\n",
       "                        <tbody>\r\n",
       "                        \r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|0000\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-d5d87166-2f6f-4cf4-97f8-f2acc3171523\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-d5d87166-2f6f-4cf4-97f8-f2acc3171523\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|0101\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-82109471-bab7-45e2-8989-6a7cb00c2427\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-82109471-bab7-45e2-8989-6a7cb00c2427\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|1010\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-c0859fbb-05f0-4b1e-b4be-083f743b7ace\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-c0859fbb-05f0-4b1e-b4be-083f743b7ace\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|1111\\right\\rangle$</td>\r\n",
       "                                <td>$0.5000 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"25.00000000000001\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-4a916dbe-5123-489c-890d-ce0365eb90ce\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 25.00000000000001;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-4a916dbe-5123-489c-890d-ce0365eb90ce\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \r\n",
       "                        </tbody>\r\n",
       "                    </table>"
      ],
      "text/plain": [
       "|0000⟩\t0.5000000000000001 + 0𝑖\n",
       "|0101⟩\t0.5000000000000001 + 0𝑖\n",
       "|1010⟩\t0.5000000000000001 + 0𝑖\n",
       "|1111⟩\t0.5000000000000001 + 0𝑖"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "{\"@type\":\"tuple\"}",
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate DumpEntangledState"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To get a list of current configuration settings, run `%config` without an argument."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"rows\":[{\"Key\":\"dump.truncateSmallAmplitudes\",\"Value\":true},{\"Key\":\"dump.basisStateLabelingConvention\",\"Value\":\"bitstring\"}]}",
      "text/html": [
       "<table><thead><tr><th style=\"text-align: start;\">Configuration key</th><th style=\"text-align: start;\">Value</th></tr></thead><tbody><tr><td style=\"text-align: start;\">dump.truncateSmallAmplitudes</td><td style=\"text-align: start;\">true</td></tr><tr><td style=\"text-align: start;\">dump.basisStateLabelingConvention</td><td style=\"text-align: start;\">\"bitstring\"</td></tr></tbody></table>"
      ],
      "text/plain": [
       "Configuration key                 Value\r\n",
       "--------------------------------- -----------\r\n",
       "dump.truncateSmallAmplitudes      true\r\n",
       "dump.basisStateLabelingConvention \"bitstring\"\r\n"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%config"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dumping Unitary Representations of Operations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `QuantumSimulator` target also allows you to display unitary representations of adjointable and controllable operations. To do so, call the [`DumpOperation` operation](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.diagnostics.dumpoperation) with the operation you'd like to represent as an input."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"DumpCnot\"]",
      "text/html": [
       "<ul><li>DumpCnot</li></ul>"
      ],
      "text/plain": [
       "DumpCnot"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operation DumpCnot() : Unit {\n",
    "    DumpOperation(2, ApplyToFirstTwoQubitsCA(CNOT, _));\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\r\n",
       "                    <table>\r\n",
       "                        <tr>\r\n",
       "                            <th>Qubit IDs</th>\r\n",
       "                            <td>2, 3\r\n",
       "                        </tr>\r\n",
       "\r\n",
       "                        <tr>\r\n",
       "                            <th>Unitary representation</th>\r\n",
       "                            <td>$$\r\n",
       "                                \\left(\\begin{matrix}\r\n",
       "                                    1 & 0 & 0 & 0 \\\\\n",
       "0 & 0 & 0 & 1 \\\\\n",
       "0 & 0 & 1 & 0 \\\\\n",
       "0 & 1 & 0 & 0\r\n",
       "                                \\end{matrix}\\right)\r\n",
       "                            $$</td>\r\n",
       "                        </tr>\r\n",
       "                    </table>\r\n",
       "                "
      ],
      "text/plain": [
       "Real:\n",
       "[[1, 0, 0, 0], \r\n",
       "[0, 0, 0, 1], \r\n",
       "[0, 0, 1, 0], \r\n",
       "[0, 1, 0, 0]]\n",
       "Imag:\n",
       "[[0, 0, 0, 0], \r\n",
       "[0, 0, 0, 0], \r\n",
       "[0, 0, 0, 0], \r\n",
       "[0, 0, 0, 0]]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "{\"@type\":\"tuple\"}",
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate DumpCnot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"DumpSwap\"]",
      "text/html": [
       "<ul><li>DumpSwap</li></ul>"
      ],
      "text/plain": [
       "DumpSwap"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operation DumpSwap() : Unit {\n",
    "    DumpOperation(2, ApplyToFirstTwoQubitsCA(SWAP, _));\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\r\n",
       "                    <table>\r\n",
       "                        <tr>\r\n",
       "                            <th>Qubit IDs</th>\r\n",
       "                            <td>2, 3\r\n",
       "                        </tr>\r\n",
       "\r\n",
       "                        <tr>\r\n",
       "                            <th>Unitary representation</th>\r\n",
       "                            <td>$$\r\n",
       "                                \\left(\\begin{matrix}\r\n",
       "                                    1 & 0 & 0 & 0 \\\\\n",
       "0 & 0 & 1 & 0 \\\\\n",
       "0 & 1 & 0 & 0 \\\\\n",
       "0 & 0 & 0 & 1\r\n",
       "                                \\end{matrix}\\right)\r\n",
       "                            $$</td>\r\n",
       "                        </tr>\r\n",
       "                    </table>\r\n",
       "                "
      ],
      "text/plain": [
       "Real:\n",
       "[[1, 0, 0, 0], \r\n",
       "[0, 0, 1, 0], \r\n",
       "[0, 1, 0, 0], \r\n",
       "[0, 0, 0, 1]]\n",
       "Imag:\n",
       "[[0, 0, 0, 0], \r\n",
       "[0, 0, 0, 0], \r\n",
       "[0, 0, 0, 0], \r\n",
       "[0, 0, 0, 0]]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "{\"@type\":\"tuple\"}",
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate DumpSwap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"DumpT\"]",
      "text/html": [
       "<ul><li>DumpT</li></ul>"
      ],
      "text/plain": [
       "DumpT"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operation DumpT() : Unit {\n",
    "    DumpOperation(1, ApplyToFirstQubitCA(T, _));\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\r\n",
       "                    <table>\r\n",
       "                        <tr>\r\n",
       "                            <th>Qubit IDs</th>\r\n",
       "                            <td>1\r\n",
       "                        </tr>\r\n",
       "\r\n",
       "                        <tr>\r\n",
       "                            <th>Unitary representation</th>\r\n",
       "                            <td>$$\r\n",
       "                                \\left(\\begin{matrix}\r\n",
       "                                    1 & 0 \\\\\n",
       "0 & 0.707 + 0.707i\r\n",
       "                                \\end{matrix}\\right)\r\n",
       "                            $$</td>\r\n",
       "                        </tr>\r\n",
       "                    </table>\r\n",
       "                "
      ],
      "text/plain": [
       "Real:\n",
       "[[1, 0], \r\n",
       "[0, 0.7071067811865476]]\n",
       "Imag:\n",
       "[[0, 0], \r\n",
       "[0, 0.7071067811865476]]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "{\"@type\":\"tuple\"}",
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate DumpT"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Epilog"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"rows\":[{\"@type\":\"@tuple\",\"Item1\":\"iqsharp\",\"Item2\":\"0.15.2101125897\"},{\"@type\":\"@tuple\",\"Item1\":\"Jupyter Core\",\"Item2\":\"1.5.0.0\"},{\"@type\":\"@tuple\",\"Item1\":\".NET Runtime\",\"Item2\":\".NETCoreApp,Version=v3.1\"}]}",
      "text/html": [
       "<table><thead><tr><th style=\"text-align: start;\">Component</th><th style=\"text-align: start;\">Version</th></tr></thead><tbody><tr><td style=\"text-align: start;\">iqsharp</td><td style=\"text-align: start;\">0.15.2101125897</td></tr><tr><td style=\"text-align: start;\">Jupyter Core</td><td style=\"text-align: start;\">1.5.0.0</td></tr><tr><td style=\"text-align: start;\">.NET Runtime</td><td style=\"text-align: start;\">.NETCoreApp,Version=v3.1</td></tr></tbody></table>"
      ],
      "text/plain": [
       "Component    Version\r\n",
       "------------ ------------------------\r\n",
       "iqsharp      0.15.2101125897\r\n",
       "Jupyter Core 1.5.0.0\r\n",
       ".NET Runtime .NETCoreApp,Version=v3.1\r\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Q#",
   "language": "qsharp",
   "name": "iqsharp"
  },
  "language_info": {
   "file_extension": ".qs",
   "mimetype": "text/x-qsharp",
   "name": "qsharp",
   "version": "0.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
